home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Graphics Plus
/
Graphics Plus.iso
/
general
/
viewers
/
polyview
/
polyvw31.lha
/
Polyview3.1
/
new
/
pvtext.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-08-24
|
48KB
|
1,787 lines
/*****************************************************************************
* NCSA Polyview 3.1 *
* *
* Version 3.1 changes and additions by Gilles Bourhis *
* Version 3 changes and additions by Marc Andreessen. *
* Version 2 by Brian Calvert. *
* *
* Software Development Group *
* National Center for Supercomputing Applications *
* University of Illinois at Urbana-Champaign *
* *
* This is BETA release software. As such it may contain software bugs and *
* exhibit inconsistencies. *
* *
* Please send bug reports to polyview@ncsa.uiuc.edu. *
* *
* Copyright (c) 1992 The Board of Trustees of the University of Illinois. *
* *
* Permission to use, copy, and modify this software and its *
* documentation for educational, research, and non-profit purposes is *
* hereby granted, provided that the above copyright notice, the original *
* authors names, and this permission notice appear in all such copies. *
* Any distribution of this software requires the explicit and written *
* authorization of the authors. *
* *
* The University of Illinois makes no representations about the *
* suitability of this software for any purpose. It is provided "as is" *
* without warranty of any kind. *
*****************************************************************************/
/* $Id: pvtext.c,v 1.5 93/08/24 10:22:33 gbourhis Exp $ */
#ifdef RCSLOG
$Log: pvtext.c,v $
* Revision 1.5 93/08/24 10:22:33 gbourhis
* set win->credits_flag to false in do_overlay_all_off().
*
* Revision 1.4 93/08/13 12:15:49 gbourhis
* add "save rgb [<%s:filename>]" command, changes in do_data_dtm().
*
* Revision 1.3 93/07/13 16:41:22 gbourhis
* add do_data_coord(), call data_dtm_explicit() in do_data_dtm() if
* already connected.
*
* Revision 1.2 93/06/24 16:30:46 gbourhis
* add movecursor & movecursorend.
*
* Revision 1.1 1992/09/18 10:55:26 marca
* Initial revision
*
#endif
#include "pv.h"
#ifdef __sgi
#include <gl/sphere.h>
#endif
#ifdef _IBMR2
#include "/usr/lpp/GL/utilities/inc/sphere.h"
#endif /* _IBMR2 */
#define GFA(n,d) get_float_arg(action->argc,action->arg,n,d)
#define GSA(n,d) get_string_arg(action->argc,action->arg,n,d)
#define GKA(n) get_keyword_arg(action->argc,action->arg,n)
int do_abort (state_t *state, action_t *action, window_t *win)
{
return abort_actions(state);
}
/* ANIMATION: */
int do_animate (state_t *state, action_t *action, window_t *win)
{
/* Create the dialog, if necessary; else just pop up to
the top of the stack. */
PLAYAFILE ("/usr/lib/sounds/prosonus/musictags/belltree_up2.aiff");
if (state->animate_window == NULL)
create_animate_dialog (state);
else
XmxManageRemanage (state->animate_window->base);
return ST_OKAY;
}
int do_animate_reverse (state_t *state, action_t *action, window_t *win)
{
return animate_reverse
(state, win, (int) get_float_arg
(action->argc, action->arg, "framecount", -1.0));
}
int do_time_reverse_step (state_t *state, action_t *action, window_t *win)
{
return animate_reverse(state, win, 1);
}
int do_time_forward_step (state_t *state, action_t *action, window_t *win)
{
return animate_forward(state, win, 1);
}
int do_animate_forward (state_t *state, action_t *action, window_t *win)
{
return animate_forward
(state, win, (int) get_float_arg
(action->argc, action->arg, "framecount", -1.0));
}
int do_animate_goto (state_t *state, action_t *action, window_t *win)
{
return animate_goto
(state, win,
get_string_arg(action->argc, action->arg, "framename", "*"));
}
int do_animate_goto_num (state_t *state, action_t *action, window_t *win)
{
return animate_goto_num
(state, win,
(int) get_float_arg(action->argc,action->arg,"framenum", 0.0));
}
int do_animate_stop (state_t *state, action_t *action, window_t *win)
{
return animate_stop(state, win);
}
int do_time_delay (state_t *state, action_t *action, window_t *win)
{
return time_delay
(state, win,
(int) get_float_arg(action->argc, action->arg, "delay", 5.0));
}
int do_time_skip (state_t *state, action_t *action, window_t *win)
{
return time_skip
(state, win,
(int) get_float_arg(action->argc, action->arg, "skip", 0.0));
}
int do_animate_reset (state_t *state, action_t *action, window_t *win)
{
return animate_reset(state, win);
}
int do_time_bounce (state_t *state, action_t *action, window_t *win)
{
if (strcmp("on", get_keyword_arg (action->argc, action->arg, 2)) == 0)
win->bounce = 1;
else
win->bounce = 0;
return ST_OKAY;
}
/* ------------------------------------------------------------------------ */
int do_timeblock_forward (state_t *state, action_t *action, window_t *win)
{
return timeblock_forward
(state, win, action, (int) get_float_arg
(action->argc, action->arg, "framecount", -1.0));
}
int do_timeblock_reverse (state_t *state, action_t *action, window_t *win)
{
return timeblock_reverse
(state, win, action, (int) get_float_arg
(action->argc, action->arg, "framecount", -1.0));
}
int do_pause (state_t *state, action_t *action, window_t *win)
{
return pause (state, win, action, (int) get_float_arg
(action->argc, action->arg, "count", 1.0));
}
/* ------------------------------------------------------------------------ */
/* COLORMAP: */
int do_cm_load_hdf (state_t *state, action_t *action, window_t *win)
{
/* Make the name the new default. */
strcpy(WIN_INPALETTE(win), GSA("palettepath", WIN_INPALETTE(win)));
return cm_load_hdf(state, win, WIN_INPALETTE(win));
}
int do_cm_load_raw (state_t *state, action_t *action, window_t *win)
{
/* Make the name the new default. */
strcpy(WIN_INPALETTE(win), GSA("palettepath", WIN_INPALETTE(win)));
return cm_load_raw(state, win, WIN_INPALETTE(win));
}
int do_cm_put_hdf (state_t *state, action_t *action, window_t *win)
{
/* Make the name the new default. */
strcpy(WIN_OUTPALETTE(win), GSA("palettepath", WIN_OUTPALETTE(win)));
return cm_put_hdf(state, win, WIN_OUTPALETTE(win));
}
int do_cm_put_raw (state_t *state, action_t *action, window_t *win)
{
/* Make the name the new default. */
strcpy(WIN_OUTPALETTE(win), GSA("palettepath", WIN_OUTPALETTE(win)));
return cm_put_raw(state, win, WIN_OUTPALETTE(win));
}
int do_cm_reset (state_t *state, action_t *action, window_t *win)
{
return cm_reset(state, win);
}
int do_cm_scale (state_t *state, action_t *action, window_t *win)
{
int single;
/* Set the boolean single TRUE if the command indicated a constant */
/* change in scaling. */
if (strcmp("single", get_keyword_arg(action->argc, action->arg, 3))
== 0) {
single = TRUE;
}
else {
single = FALSE;
}
return cm_scale
(state, win,
get_float_arg(action->argc, action->arg, "scalestep", 1.0),
single);
}
int do_cm_shift (state_t *state, action_t *action, window_t *win)
{
int single;
/* Set the boolean single TRUE if the command indicated a constant */
/* change in scaling. */
if (strcmp("single", get_keyword_arg(action->argc, action->arg, 3)) == 0)
single = TRUE;
else
single = FALSE;
return cm_shift
(state, win,
get_float_arg(action->argc, action->arg, "shiftstep", 0.0),
single);
}
int do_cm_fiddle (state_t *state, action_t *action, window_t *win)
{
palette_t *pal;
if (STA_PALETTE(state) == NULL)
return ST_OKAY;
pal = (palette_t *)WIN_IMAGE(STA_PALETTE(state));
pal->slope = get_float_arg (action->argc, action->arg, "slope", 0.0);
pal->origin = get_float_arg (action->argc, action->arg, "origin", 0.0);
set_palette (state, pal, PAL_MAP);
set_redraw (state, win);
return ST_OKAY;
}
int do_cm_load (state_t *state, action_t *action, window_t *win)
{
char *cmname;
int colormap;
/* Get the colormap name from the action record. */
cmname = get_keyword_arg(action->argc, action->arg, 2);
/* If the name is not specified, simply reset the palette. */
if (cmname == NULL)
{
return cm_reset(state, win);
}
else
{
if (strcmp("default", cmname) == 0)
colormap = PAL_DEFAULT;
else if (strcmp("rainbow", cmname) == 0)
colormap = PAL_RAINBOW;
else if (strcmp("w_to_b", cmname) == 0)
colormap = PAL_W_TO_B;
else if (strcmp("b_to_w", cmname) == 0)
colormap = PAL_B_TO_W;
else if (strcmp("rgb", cmname) == 0)
colormap = PAL_RGB;
else if (strcmp("allyellow", cmname) == 0)
colormap = PAL_ALLYELLOW;
else if (strcmp("redblue", cmname) == 0)
colormap = PAL_REDBLUE;
else if (strcmp("whiteblue", cmname) == 0)
colormap = PAL_WHITEBLUE;
else if (strcmp("yellowred", cmname) == 0)
colormap = PAL_YELLOWRED;
return cm_load(state, win, colormap);
}
}
/* SCRIPTING: */
int do_do (state_t *state, action_t *action, window_t *win)
{
return do_script(state, action, win);
}
int do_script (state_t *state, action_t *action, window_t *win)
{
char *filename;
/* Get the filename. */
filename = get_string_arg(action->argc, action->arg, "scriptfile", "");
/* If there's no filename, open a dialog box. */
if (filename[0] == '\0')
{
XmxMakeErrorDialog (win->base,
"ERROR: Cannot open script file.",
"Error While Loading Script");
XtManageChild (Xmx_w);
return ST_ERROR;
}
return script(state, win, filename);
}
/* DEBUGGING: */
int do_dump (state_t *state, action_t *action, window_t *win)
{
int dump_files(state_t *);
return dump_files(state);
}
extern void remote_movecursor (state_t *, window_t *, float, float);
int do_movecursor (state_t *state, action_t *action, window_t *win)
{
float x, y;
x = get_float_arg(action->argc, action->arg, "xmove", 0.0);
y = get_float_arg(action->argc, action->arg, "ymove", 0.0);
fprintf (stderr, "Shit for Brains %f %f\n", x, y);
remote_movecursor (state, win, x, y);
return ST_OKAY;
}
int do_movecursorend (state_t *state, action_t *action, window_t *win)
{
remote_movecursorend (state, win);
return ST_OKAY;
}
/* MOVE: */
int setup_move_camera (state_t *state, action_t *action, window_t *win)
{
float to_0, to_1, to_2;
Angle twist;
if (WIN_STEP(win) <= 0.0)
{
bprintf(state,
"ERROR: move step is %.2f.\n", WIN_STEP(win));
return ST_ERROR;
}
/* Get the destination position. */
to_0 = get_float_arg(action->argc, action->arg, "to0",0.0);
to_1 = get_float_arg(action->argc, action->arg, "to1",0.0);
to_2 = get_float_arg(action->argc, action->arg, "to2",0.0);
twist = (Angle)get_float_arg(action->argc, action->arg, "twist", WIN_TWIST(win));
if (FEQ(to_0, WIN_CFROM(win)[X]) &&
FEQ(to_1, WIN_CFROM(win)[Y]) &&
FEQ(to_2, WIN_CFROM(win)[Z]) &&
twist == WIN_TWIST(win))
{
return ST_OKAY;
}
return move_camera(state, win, action, WIN_MOVEPATH(win),
to_0, to_1, to_2, twist);
}
int setup_move_ref_pt (state_t *state, action_t *action, window_t *win)
{
float to_0, to_1, to_2;
if (WIN_STEP(win) <= 0.0) {
bprintf(state,
"WARNING: move step is %.2f\n", WIN_STEP(win));
return ST_ERROR;
}
to_0 = get_float_arg
(action->argc, action->arg, "to0",
(WIN_STATS(win,PX).max+
WIN_STATS(win,PX).min)/2.0);
to_1 = get_float_arg
(action->argc, action->arg, "to1",
(WIN_STATS(win,PY).max+
WIN_STATS(win,PY).min)/2.0);
to_2 = get_float_arg
(action->argc, action->arg, "to2",
(WIN_STATS(win,PZ).max+
WIN_STATS(win,PZ).min)/2.0);
return move_ref_pt(state, win, action, to_0, to_1, to_2);
}
int setup_move_ref_sel (state_t *state, action_t *action, window_t *win)
{
return move_ref_sel(state, win, action);
}
int do_move_path (state_t *state, action_t *action, window_t *win)
{
int movepath;
if (strcmp(get_keyword_arg(action->argc, action->arg, 2), "cartesian") == 0)
movepath = CARTESIAN;
else
movepath = SPHERICAL;
return move_path(state, win, movepath);
}
int do_move_step (state_t *state, action_t *action, window_t *win)
{
return move_step
(state, win,
get_float_arg (action->argc, action->arg, "movestepsize",
WIN_MAXWIDTH(win)/20.0));
}
/* JUMP: */
int do_jump_camera (state_t *state, action_t *action, window_t *win)
{
return jump_camera
(state, win, action->countdown,
get_float_arg(action->argc, action->arg, "to0", 0.0),
get_float_arg(action->argc, action->arg, "to1", 0.0),
get_float_arg(action->argc, action->arg, "to2", 0.0),
(Angle)get_float_arg(action->argc, action->arg, "twist", WIN_TWIST(win)));
}
int do_jump_ref_pt (state_t *state, action_t *action, window_t *win)
{
return jump_ref_pt
(state, win, action->countdown+1,
get_float_arg(action->argc, action->arg, "to0",
(WIN_STATS(win,PX).max+
WIN_STATS(win,PX).min)/2.0),
get_float_arg(action->argc, action->arg, "to1",
(WIN_STATS(win,PY).max+
WIN_STATS(win,PY).min)/2.0),
get_float_arg(action->argc, action->arg, "to2",
(WIN_STATS(win,PZ).max+
WIN_STATS(win,PZ).min)/2.0));
}
int do_jump_ref_sel (state_t *state, action_t *action, window_t *win)
{
return jump_ref_sel(state, win);
}
/* Overlays: */
int do_overlay_axes (state_t *state, action_t *action, window_t *win)
{
char *keyword;
int style;
keyword = get_keyword_arg(action->argc, action->arg, 2);
if (strcmp(keyword, "toggle") == 0)
style = TOGGLE;
else if (strcmp(keyword, "small") == 0)
style = AXESSMALL;
else if (strcmp(keyword, "large") == 0)
style = AXESLARGE;
else if (strcmp(keyword, "off") == 0)
style = NONE;
return set_overlay(state, win, AXESSMALL|AXESLARGE, style, TRUE);
}
int do_overlay_box (state_t *state, action_t *action, window_t *win)
{
char *keyword;
int style;
keyword = get_keyword_arg(action->argc, action->arg, 2);
if (strcmp(keyword, "toggle") == 0)
style = TOGGLE;
else if (strcmp(keyword, "all") == 0)
style = BOXSHADED|BOXWIRE;
else if (strcmp(keyword, "faces") == 0)
style = BOXSHADED;
else if (strcmp(keyword, "edges") == 0)
style = BOXWIRE;
else if (strcmp(keyword, "off") == 0)
style = NONE;
else
{
stprintf(state, "ERROR: Illegal overlay box parameter.\n");
return ST_ERROR;
}
return set_overlay(state, win, (BOXSHADED|BOXWIRE), style, TRUE);
}
int do_overlay_focus (state_t *state, action_t *action, window_t *win)
{
char *keyword;
int style;
keyword = get_keyword_arg(action->argc, action->arg, 2);
if (strcmp(keyword, "toggle") == 0) {
style = TOGGLE;
}
else if (strcmp(keyword, "on") == 0) {
style = FOCUSPOINT;
}
else if (strcmp(keyword, "off") == 0) {
style = NONE;
}
return set_overlay(state, win, FOCUSPOINT, style, TRUE);
}
int do_overlay_grid (state_t *state, action_t *action, window_t *win)
{
char *keyword;
int style, type;
keyword = get_keyword_arg(action->argc, action->arg, 2);
type = GRIDALL;
if (strcmp(keyword, "all") == 0) {
style = GRIDALL;
}
else if (strcmp(keyword, "xy") == 0) {
style = TOGGLE;
type = GRIDXY;
}
else if (strcmp(keyword, "yz") == 0) {
style = TOGGLE;
type = GRIDYZ;
}
else if (strcmp(keyword, "xz") == 0) {
style = TOGGLE;
type = GRIDXZ;
}
else if (strcmp(keyword, "off") == 0) {
style = NONE;
}
return set_overlay(state, win, type, style, TRUE);
}
int do_overlay_shadow (state_t *state, action_t *action, window_t *win)
{
char *keyword;
int style, type;
keyword = get_keyword_arg(action->argc, action->arg, 2);
type = SCATALL;
if (strcmp(keyword, "all") == 0) {
style = SCATALL;
}
else if (strcmp(keyword, "xy") == 0) {
style = TOGGLE;
type = SCATXY;
}
else if (strcmp(keyword, "yz") == 0) {
style = TOGGLE;
type = SCATYZ;
}
else if (strcmp(keyword, "xz") == 0) {
style = TOGGLE;
type = SCATXZ;
}
else if (strcmp(keyword, "off") == 0) {
style = NONE;
}
/* These are disabled below; don't blame me, it's BC's fault. */
else if (strcmp(keyword, "vertices") == 0) {
return set_over_shadow_vertices(state, win);
}
else if (strcmp(keyword, "edges") == 0) {
return set_over_shadow_lines(state, win);
}
else if (strcmp(keyword, "faces") == 0) {
return set_over_shadow_solid(state, win);
}
return set_overlay(state, win, type, style, FALSE);
}
int do_legend (state_t *state, action_t *action, window_t *win)
{
char *keyword;
keyword = get_keyword_arg(action->argc, action->arg, 2);
if (strcmp(keyword, "off") == 0)
win->legend_flag = 0;
else
win->legend_flag = 1;
set_redraw (state, win);
GUIpviewResetProps (state, win);
return ST_OKAY;
}
int do_credits (state_t *state, action_t *action, window_t *win)
{
char *keyword;
keyword = get_keyword_arg(action->argc, action->arg, 2);
if (strcmp(keyword, "off") == 0)
win->credits_flag = 0;
else
win->credits_flag = 1;
set_redraw (state, win);
return ST_OKAY;
}
int do_overlay_all_off (state_t *state, action_t *action, window_t *win)
{
win->legend_flag = 0;
win->credits_flag = 0;
set_overlay(state, win, ALL, NONE, FALSE);
return set_overlay(state, win, ALL, NONE, TRUE);
}
/* Projections: */
int do_project_ortho (state_t *state, action_t *action, window_t *win)
{
return project_ortho(state, win);
}
int do_shade_flat (state_t *state, action_t *action, window_t *win)
{
WIN_SHADE(win) = FLAT;
set_redraw(state, win);
GUIpviewResetRender (state, win);
return ST_OKAY;
}
int do_shade_gouraud (state_t *state, action_t *action, window_t *win)
{
WIN_SHADE(win) = GOURAUD;
set_redraw(state, win);
GUIpviewResetRender (state, win);
return ST_OKAY;
}
int do_project_perspective (state_t *state, action_t *action, window_t *win)
{
return project_perspective(state, win);
}
int do_quit (state_t *state, action_t *action, window_t *win)
{
return quit(state);
}
/* DRAW: */
int do_draw_nothing (state_t *state, action_t *action, window_t *win)
{
return set_draw_nothing(state, win);
}
int do_draw_vertices (state_t *state, action_t *action, window_t *win)
{
return set_draw_vertices(state, win);
}
int do_draw_lines (state_t *state, action_t *action, window_t *win)
{
return set_draw_lines(state, win);
}
int do_draw_hidden_edges (state_t *state, action_t *action, window_t *win)
{
return set_draw_hidden_edges(state, win);
}
int do_draw_transparent (state_t *state, action_t *action, window_t *win)
{
return set_draw_transparent(state, win);
}
int do_draw_solid (state_t *state, action_t *action, window_t *win)
{
return set_draw_solid(state, win);
}
int do_draw_outlined (state_t *state, action_t *action, window_t *win)
{
return set_draw_outlined(state, win);
}
int do_draw_outlined_white (state_t *state, action_t *action, window_t *win)
{
WIN_OUTLINE_COLOR(win) = 0xffffff;
GUIpviewResetOutline (state, win);
return set_draw_outlined(state, win);
}
int do_draw_outlined_black (state_t *state, action_t *action, window_t *win)
{
WIN_OUTLINE_COLOR(win) = 0x000000;
GUIpviewResetOutline (state, win);
return set_draw_outlined(state, win);
}
int do_draw_outlined_color (state_t *state, action_t *action, window_t *win)
{
float col;
int c;
col = get_float_arg (action->argc, action->arg, "color", 1.0);
if (col > 1.0)
col = 1.0;
if (col < 0.0)
col = 0.0;
c = (int)(col * 255.0);
WIN_OUTLINE_COLOR(win) = c + (c << 8) + (c << 16);
GUIpviewResetOutline (state, win);
return set_draw_outlined(state, win);
}
int do_draw_linewidth (state_t *state, action_t *action, window_t *win)
{
int width;
width = (int)get_float_arg (action->argc, action->arg, "linewidth", 1.0);
if (width < 1)
width = 1;
if (width > 10)
width = 10;
win->line_width = width;
GUIpviewResetLinewidth (state, win);
set_redraw (state, win);
return ST_OKAY;
}
int do_sphere_size (state_t *state, action_t *action, window_t *win)
{
win->sphere_size = get_float_arg
(action->argc, action->arg, "spheresize", 0.0);
GUIpviewResetSphere (state, win);
set_redraw(state, win);
return;
}
int do_sphere_depth (state_t *state, action_t *action, window_t *win)
{
win->sphere_depth =
(int)get_float_arg (action->argc, action->arg, "spheredepth", 2);
if (win->sphere_depth < 1 || win->sphere_depth > SPH_MAXDEPTH)
win->sphere_depth = 2;
GUIpviewResetSphere (state, win);
set_redraw (state, win);
return;
}
int do_backdrop (state_t *state, action_t *action, window_t *win)
{
char *type, *col;
type = get_keyword_arg(action->argc, action->arg, 1);
col = get_keyword_arg(action->argc, action->arg, 2);
win->backdrop = -1;
if (STREQ(type, "solid"))
{
if (STREQ(col, "black"))
win->backdrop = PV_PALETTE_BACKG_BLACK;
if (STREQ (col, "white"))
win->backdrop = PV_PALETTE_BACKG_WHITE;
if (STREQ (col, "grey"))
win->backdrop = PV_PALETTE_BACKG_GREY;
if (STREQ (col, "blue"))
win->backdrop = PV_PALETTE_BACKG_BLUE;
if (STREQ (col, "red"))
win->backdrop = PV_PALETTE_BACKG_RED;
}
if (STREQ(type, "horizon"))
{
if (STREQ (col, "blue"))
win->backdrop = PV_PALETTE_BACKG_BLUEHORIZ;
if (STREQ (col, "red"))
win->backdrop = PV_PALETTE_BACKG_REDHORIZ;
if (STREQ (col, "green"))
win->backdrop = PV_PALETTE_BACKG_GREENHORIZ;
if (STREQ (col, "yellow"))
win->backdrop = PV_PALETTE_BACKG_YELLOWHORIZ;
}
if (STREQ(type, "sky"))
{
if (STREQ (col, "blue"))
win->backdrop = PV_PALETTE_BACKG_BLUESKY;
if (STREQ (col, "red"))
win->backdrop = PV_PALETTE_BACKG_REDSKY;
if (STREQ (col, "green"))
win->backdrop = PV_PALETTE_BACKG_GREENSKY;
if (STREQ (col, "yellow"))
win->backdrop = PV_PALETTE_BACKG_YELLOWSKY;
}
if (STREQ(type, "streak"))
{
if (STREQ (col, "blue"))
win->backdrop = PV_PALETTE_BACKG_BLUESTREAK;
if (STREQ (col, "red"))
win->backdrop = PV_PALETTE_BACKG_REDSTREAK;
if (STREQ (col, "green"))
win->backdrop = PV_PALETTE_BACKG_GREENSTREAK;
if (STREQ (col, "yellow"))
win->backdrop = PV_PALETTE_BACKG_YELLOWSTREAK;
}
if (STREQ(type, "smear"))
{
if (STREQ (col, "blue"))
win->backdrop = PV_PALETTE_BACKG_BLUESMEAR;
if (STREQ (col, "red"))
win->backdrop = PV_PALETTE_BACKG_REDSMEAR;
if (STREQ (col, "green"))
win->backdrop = PV_PALETTE_BACKG_GREENSMEAR;
if (STREQ (col, "yellow"))
win->backdrop = PV_PALETTE_BACKG_YELLOWSMEAR;
}
if (STREQ(type, "shaded"))
{
if (STREQ (col, "rgby"))
win->backdrop = PV_PALETTE_BACKG_RGBY;
if (STREQ (col, "rgblue"))
win->backdrop = PV_PALETTE_BACKG_RGBLUE;
if (STREQ (col, "rbblack"))
win->backdrop = PV_PALETTE_BACKG_RBBLACK;
}
if (win->backdrop == -1)
{
stprintf (state, "ERROR: No backdrop with that name.");
win->backdrop = PV_PALETTE_BACKG_BLACK;
}
/* Do something about adjusting the palette dialog. */
set_redraw (state, win);
GUIpaletteResetBackdrop (state, win);
return;
}
int do_light_one (state_t *state, action_t *action, window_t *win)
{
WIN_LIGHT(win) = 1;
WIN_LIGHT_X(win) = 0.5;
WIN_LIGHT_Y(win) = 0.5;
WIN_LIGHT_Z(win) = 0.707;
set_redraw(state,win);
GUIpviewResetRender (state, win);
return ST_OKAY;
}
int do_light_two (state_t *state, action_t *action, window_t *win)
{
WIN_LIGHT(win) = 1;
WIN_LIGHT_X(win) = -0.5;
WIN_LIGHT_Y(win) = -0.5;
WIN_LIGHT_Z(win) = 0.707;
set_redraw(state,win);
GUIpviewResetRender (state, win);
return ST_OKAY;
}
int do_light_three (state_t *state, action_t *action, window_t *win)
{
WIN_LIGHT(win) = 1;
WIN_LIGHT_X(win) = 0.707;
WIN_LIGHT_Y(win) = -0.5;
WIN_LIGHT_Z(win) = -0.5;
set_redraw(state,win);
GUIpviewResetRender (state, win);
return ST_OKAY;
}
int do_light_x (state_t *state, action_t *action, window_t *win)
{
WIN_LIGHT(win) = 1;
WIN_LIGHT_X(win) = 1;
WIN_LIGHT_Y(win) = 0.0;
WIN_LIGHT_Z(win) = 0.0;
set_redraw(state,win);
GUIpviewResetRender (state, win);
return ST_OKAY;
}
int do_light_y (state_t *state, action_t *action, window_t *win)
{
WIN_LIGHT(win) = 1;
WIN_LIGHT_X(win) = 0.0;
WIN_LIGHT_Y(win) = 1.0;
WIN_LIGHT_Z(win) = 0.0;
set_redraw(state,win);
GUIpviewResetRender (state, win);
return ST_OKAY;
}
int do_light_z(state_t *state, action_t *action, window_t *win)
{
WIN_LIGHT(win) = 1;
WIN_LIGHT_X(win) = 0.0;
WIN_LIGHT_Y(win) = 0.0;
WIN_LIGHT_Z(win) = 1.0;
set_redraw(state,win);
GUIpviewResetRender (state, win);
return ST_OKAY;
}
int do_light_twoside_on (state_t *state, action_t *action, window_t *win)
{
light_twoside_on (state, win);
set_redraw(state,win);
GUIpviewResetRender (state, win);
return ST_OKAY;
}
int do_light_twoside_off (state_t *state, action_t *action, window_t *win)
{
light_twoside_off (state, win);
set_redraw(state,win);
GUIpviewResetRender (state, win);
return ST_OKAY;
}
int do_light_off(state_t *state, action_t *action, window_t *win)
{
WIN_LIGHT(win) = 0;
set_redraw(state,win);
GUIpviewResetRender (state, win);
return ST_OKAY;
}
int do_drag(state_t *state, action_t *action, window_t *win)
{
int (*fast_fn)();
char *fastrep;
fastrep = get_keyword_arg(action->argc,action->arg,1);
if (strcmp(fastrep, "toggle") == 0)
fast_fn = draw_edges;
else if (strncmp(fastrep, "sam", 3) == 0)
fast_fn = NULL;
else if (strncmp(fastrep, "not", 3) == 0)
fast_fn = draw_nothing;
else if (strncmp(fastrep, "box", 3) == 0)
fast_fn = draw_box;
else if (strncmp(fastrep, "ver", 3) == 0)
fast_fn = draw_vertices;
else if (strncmp(fastrep, "edg", 3) == 0)
fast_fn = draw_edges;
else if (strncmp(fastrep, "hid", 3) == 0)
fast_fn = draw_hidden_edges;
else if (strncmp(fastrep, "tra", 3) == 0)
fast_fn = DrawTrans;
else if (strncmp(fastrep, "fac", 3) == 0)
fast_fn = draw_faces;
else if (strncmp(fastrep, "out", 3) == 0)
fast_fn = draw_outlined_faces;
else
fast_fn = NULL;
return set_draw_fast(state, win, fast_fn);
}
int do_reset(state_t *state, action_t *action, window_t *win)
{
return reset(state, win);
}
/* DATA: */
int do_data_clear(state_t *state, action_t *action, window_t *win)
{
return data_clear(state, win);
}
int do_data_file(state_t *state, action_t *action, window_t *win)
{
return data_file(state, win,
get_string_arg(action->argc, action->arg, "filename", ""));
}
/* mods by G. Bourhis :
the "data dtm" command don't expect a port#, it just state that
this window will receive data over DTM.
*/
int do_data_dtm(state_t *state, action_t *action, window_t *win)
{
if (!COMdtm_out_active_p (state))
{
stprintf (state, "Warning: DTM is not yet active.");
}
return
data_dtm_explicit(state, win,
get_string_arg(action->argc, action->arg, "name",
"dtm"));
}
int do_dtm_out (state_t *state, action_t *action, window_t *win)
{
char *port;
state->next_window_dtm = 1;
if (!COMdtm_out_active_p (state))
{
port = get_string_arg (action->argc, action->arg, "port", "");
return COMdtm_out (state, win, port);
}
else
{
stprintf (state, "ERROR: DTM is already active.");
return ST_ERROR;
}
}
int do_dtm_in (state_t *state, action_t *action, window_t *win)
{
char *port;
/* Following is a miserable hack to give incoming vdatas somewhere
to land even when an input port hasn't been created explicitly
(as when a connection is active in one direction and the link is
made two-way with 'dtm out' on the secondary client side).
Calling this routine with DTM already active just sets the next
created window to be a DTM window. */
#if 0
if (!COMdtm_out_active_p (state))
{
port = get_string_arg (action->argc, action->arg, "port", "");
/* Mark the next polyview window created to be DTM. */
state->next_window_dtm = 1;
/* Open the port now. */
COMdtm_in (state, port);
}
else
{
stprintf (state, "ERROR: DTM is already active.");
return ST_OKAY;
}
#endif
if (!COMdtm_out_active_p (state))
{
/* New connection. */
port = get_string_arg (action->argc, action->arg, "port", "");
/* Mark the next polyview window created to be DTM. */
state->next_window_dtm = 1;
/* Open the port now. */
COMdtm_in (state, port);
}
else
{
/* Mark the next polyview window created to be DTM. */
state->next_window_dtm = 1;
}
return ST_OKAY;
}
int do_dtm_send (state_t *state, action_t *action, window_t *win)
{
if (!COMdtm_out_active_p (state))
stprintf (state, "Cannot send Vset; no DTM output port active.");
else
{
if (WIN_GROUP(win))
{
COMsend_vset (state, WIN_GROUP(win));
XmxMakeInfoDialog (win->base, "Vset was sent successfully.",
"Vset Sent");
XtManageChild (Xmx_w);
NetSendCommand
(NULL, "Polyview", "polyview data load", NULL, NULL);
}
else
stprintf (state, "Error: There is no Vset to send.");
}
return ST_OKAY;
}
int do_data_frame(state_t *state, action_t *action, window_t *win)
{
return data_frame
(state, win, get_string_arg(action->argc, action->arg, "framename", ""));
}
int do_data_connect(state_t *state, action_t *action, window_t *win)
{
return set_data_name(state, action, win, MCONNECT, DEF_CONNECTNAME);
}
int do_data_px(state_t *state, action_t *action, window_t *win)
{
return set_data_name(state, action, win, PX, DEF_PXNAME);
}
int do_data_py(state_t *state, action_t *action, window_t *win)
{
return set_data_name(state, action, win, PY, DEF_PYNAME);
}
int do_data_pz(state_t *state, action_t *action, window_t *win)
{
return set_data_name(state, action, win, PZ, DEF_PZNAME);
}
int do_data_coord(state_t *state, action_t *action, window_t *win)
{
return set_data_name(state, action, win, PCOORD, "pcoord");
}
int do_data_minmax(state_t *state, action_t *action, window_t *win)
{
char *axis;
char *statname;
int axisnum;
stats_t *stats;
float value;
/* Get the argument values from the command. */
axis = GKA(1);
statname = GKA(2);
value = GFA("value", 0.0);
/* Choose the axis to modify. */
if (strcmp("x-axis", axis) == 0)
axisnum = X;
else if (strcmp("y-axis", axis) == 0)
axisnum = Y;
else if (strcmp("z-axis", axis) == 0)
axisnum = Z;
/* Adjust the apppropriate statistic. */
stats = &WIN_STATS(win, axisnum);
if (strcmp("min", statname) == 0)
stats->min = value;
else if (strcmp("max", statname) == 0)
stats->max = value;
return reset(state, win);
}
int do_data_vscalar(state_t *state, action_t *action, window_t *win)
{
return set_data_name(state, action, win, MVSCALAR, DEF_VSCALARNAME);
}
int do_data_load(state_t *state, action_t *action, window_t *win)
{
return data_load(state, win, TRUE);
}
int do_data_scale(state_t *state, action_t *action, window_t *win)
{
float xscale, yscale, zscale;
xscale = get_float_arg(action->argc, action->arg, "scalex", 1.0);
yscale = get_float_arg(action->argc, action->arg, "scaley", 1.0);
zscale = get_float_arg(action->argc, action->arg, "scalez", 1.0);
return data_scale(state, win, xscale, yscale, zscale);
}
int do_data_normalize(state_t *state, action_t *action, window_t *win)
{
return data_normalize(state, win);
}
/* HELP */
int do_help(state_t *state, action_t *action, window_t *win)
{
return help(state, win);
}
int do_about (state_t *state, action_t *action, window_t *win)
{
/* Print the startup messages. */
GUIdoHelp (PV_HELP_ABOUT);
return ST_OKAY;
}
/* SELECT: */
int do_sel_all(state_t *state, action_t *action, window_t *win)
{
return sel_all(state, win);
}
int do_sel(state_t *state, action_t *action, window_t *win)
{
char *pickmode;
pickmode_t mode;
pickmode = get_keyword_arg(action->argc, action->arg, 1);
if (strcmp(pickmode, "vertices") == 0)
mode = PICK_VERTEX;
else if (strcmp(pickmode, "edges") == 0)
mode = PICK_EDGE;
else if (strcmp(pickmode, "faces") == 0)
mode = PICK_FACE;
else if (strcmp(pickmode, "objects") == 0)
mode = PICK_OBJECT;
return sel(state, win, mode);
}
int do_sel_area(state_t *state, action_t *action, window_t *win)
{
short left, right, bottom, top;
int toggle;
left = (short) get_float_arg(action->argc, action->arg, "left", 0.0);
right = (short) get_float_arg(action->argc, action->arg, "right", 0.0);
bottom = (short) get_float_arg(action->argc, action->arg, "bottom", 0.0);
top = (short) get_float_arg(action->argc, action->arg, "top", 0.0);
if (strcmp(get_keyword_arg(action->argc, action->arg, 6), "toggle") == 0)
toggle = TRUE;
else
toggle = FALSE;
return sel_region(state, win, left, right, bottom, top, toggle);
}
/* WINDOWS: */
int do_win_geometry_auto(state_t *state, action_t *action, window_t *win)
{
int mode;
if (strcmp("on", get_keyword_arg(action->argc, action->arg, 2)) == 0)
mode = AUTO;
else
mode = MANUAL;
return win_geometry_auto(state, mode);
}
int do_win_geometry(state_t *state, action_t *action, window_t *win)
{
return win_geometry
(state,
(long) get_float_arg(action->argc, action->arg, "left", 0.0),
(long) get_float_arg(action->argc, action->arg, "bottom", 0.0),
(long) get_float_arg(action->argc, action->arg, "right", 0.0),
(long) get_float_arg(action->argc, action->arg, "top", 0.0));
}
int do_win_open_palette(state_t *state, action_t *action, window_t *win)
{
PLAYAFILE ("/usr/lib/sounds/prosonus/musictags/slinky_slap.aiff");
return win_open_palette(state);
}
int do_win_open_info(state_t *state, action_t *action, window_t *win)
{
static void *w = NULL;
/* Create the dialog, if necessary. */
#if 0
if (w == NULL) {
create_info_dialog(state);
assert (w != NULL);
}
/* Open the dialog win. */
win = post_dialog(state, "information", w, notify_info);
win->init_fn = init_info;
#endif
create_info_dialog (state);
#if 0
PLAYAFILE ("/usr/lib/sounds/prosonus/musictags/harp_glis.Cmj.aiff");
XmxMakeErrorDialog (state->base,
"Sorry, the info window is not yet implemented.",
"A Thousand Pardons");
XtManageChild (Xmx_w);
#endif
return ST_OKAY;
}
int do_win_open_polyview(state_t *state, action_t *action, window_t *win)
{
PLAYAFILE ("/usr/lib/sounds/prosonus/musictags/orch_hit.aiff");
/* Go open a new polyview window. */
win_open_polyview
(state, win, get_string_arg(action->argc, action->arg, "name", ""));
/* Since this window just became active, grab it. */
win = state->active_windows;
/* If we've flagged this for receiving DTM, then explicitly do
the equivalent of 'data dtm :whatever'. */
if (state->next_window_dtm)
{
state->next_window_dtm = 0;
data_dtm_explicit (state, win, "dtm");
}
return ST_OKAY;
}
int do_win_activate (state_t *state, action_t *action, window_t *win)
{
return win_activate
(state, find_window_by_name
(state,
get_string_arg(action->argc, action->arg, "name", "*"),
POLYVIEW));
}
int do_win_close_current (state_t *state, action_t *action, window_t *win)
{
return win_close_current(state);
}
int do_win_close_palette (state_t *state, action_t *action, window_t *win)
{
return win_close_palette(state);
}
int do_win_close_time (state_t *state, action_t *action, window_t *win)
{
return win_close_time(state);
}
int do_win_close_info (state_t *state, action_t *action, window_t *win)
{
return win_close_info
(state, win, get_string_arg(action->argc, action->arg, "name", ""));
}
int do_win_close_polyview (state_t *state, action_t *action, window_t *win)
{
return win_close_polyview
(state, win, get_string_arg(action->argc, action->arg, "name", ""));
}
int do_save_mode (state_t *state, action_t *action, window_t *win)
{
/* If continuous, then set the appropriate fields in the window */
/* record. */
if (strncmp("cont", GKA(2), 4) == 0)
IsRasterContinuous(win) = TRUE;
else
IsRasterContinuous(win) = FALSE;
return ST_OKAY;
}
int do_save_image (state_t *state, action_t *action, window_t *win)
{
/* Store the raster image name. */
strcpy(WIN_RASTERNAME(win), GSA("filename", WIN_RASTERNAME(win)));
/* Write the raster image out. */
WriteRaster(state, win, WIN_RASTERNAME(win));
return ST_OKAY;
}
int do_save_ray (state_t *state, action_t *action, window_t *win)
{
dump_ray (state, win, GSA("filename", "polyview.ray"));
return ST_OKAY;
}
int do_save_rgb (state_t *state, action_t *action, window_t *win)
{
dump_rgb (state, win, GSA("filename", "polyview.rgb"));
return ST_OKAY;
}
#ifdef RENDERMAN
int do_save_renderman (state_t *state, action_t *action, window_t *win)
{
dump_renderman (state, win,
#ifdef DUMP_CFILE
GSA("filename", "polyview_renderman.c")
#else
GSA("filename", "polyview.rib")
#endif
);
return ST_OKAY;
}
#endif /* RENDERMAN */
int do_save_stop (state_t *state, action_t *action, window_t *win)
{
IsRasterContinuous(win) = FALSE;
return ST_ERROR;
}
int do_blast_mode (state_t *state, action_t *action, window_t *win)
{
/* If continuous, then set the appropriate fields in the window */
/* record. */
if (strncmp("cont", GKA(2), 4) == 0)
{
if (COMdtm_out_active_p (state))
IsRasterBlastContinuous(win) = TRUE;
else
stprintf (state, "Error: No DTM output port is active.");
}
else
IsRasterBlastContinuous(win) = FALSE;
return ST_OKAY;
}
int do_blast_image (state_t *state, action_t *action, window_t *win)
{
/* Write the raster image out. */
if (COMdtm_out_active_p (state))
WriteRasterOverDTM(state, win);
else
stprintf (state, "Error: No DTM output port is active.");
return ST_OKAY;
}
int do_blast_stop (state_t *state, action_t *action, window_t *win)
{
IsRasterBlastContinuous(win) = FALSE;
return ST_ERROR;
}
/* PARSE TABLE: */
parse_t parse_table[] = {
/* Program Execution */
{"abort", TRUE, TRUE, do_abort},
{"do <%s:scriptfile>", FALSE, TRUE, do_do},
{"help", FALSE, TRUE, do_help},
{"about polyview", FALSE, TRUE, do_about},
{"quit", TRUE, TRUE, do_quit},
{"reset", FALSE, FALSE, do_reset},
{"script <%s:scriptfile>", FALSE, TRUE, do_script},
{"pause <%f:count>", FALSE, FALSE, do_pause},
/* Windows */
{"window autoplace [on|off]", FALSE, TRUE, do_win_geometry_auto},
{"window geometry <%f:left> <%f:bottom> <%f:right> <%f:top>", FALSE, TRUE,
do_win_geometry},
{"window open information", FALSE, TRUE, do_win_open_info},
{"window open polyview [<%s:name>]", FALSE, TRUE, do_win_open_polyview},
{"window open palette", FALSE, TRUE, do_win_open_palette},
{"window open time", FALSE, TRUE, do_animate},
{"window activate <%s:name>", FALSE, TRUE, do_win_activate},
{"window close polyview <%s:name>", FALSE, FALSE, do_win_close_polyview},
{"window close current", FALSE, FALSE, do_win_close_current},
{"window close palette", FALSE, TRUE, do_win_close_palette},
{"window close information", FALSE, TRUE, do_win_close_info},
{"window close time", FALSE, TRUE, do_win_close_time},
/* Data */
{"data clear", FALSE, FALSE, do_data_clear},
{"data file <%s:filename>", FALSE, FALSE, do_data_file},
{"data dtm [<%s:name>]", FALSE, FALSE, do_data_dtm},
{"data frame [<%s:framename>]", FALSE, FALSE, do_data_frame},
{"data connect [<%s:name>]", FALSE, FALSE, do_data_connect},
{"data x-axis [<%s:name>]", FALSE, FALSE, do_data_px},
{"data y-axis [<%s:name>]", FALSE, FALSE, do_data_py},
{"data z-axis [<%s:name>]", FALSE, FALSE, do_data_pz},
{"data coordinate [<%s:name>]", FALSE, FALSE, do_data_coord},
{"data x-axis|y-axis|z-axis min|max <%f:value>",
FALSE, FALSE, do_data_minmax},
{"data color [<%s:name>]", FALSE, FALSE, do_data_vscalar},
{"data load", FALSE, FALSE, do_data_load},
{"data scale <%f:scalex> <%f:scaley> <%f:scalez>",
FALSE, FALSE, do_data_scale},
{"data normalize", FALSE, FALSE, do_data_normalize},
{"data dump [<%s:path>]", FALSE, FALSE, do_dump},
/* Draw */
/* This should be same as drag below; waste of code space. */
{"draw nothing", FALSE, FALSE, do_draw_nothing},
{"draw vertices", FALSE, FALSE, do_draw_vertices},
{"draw edges", FALSE, FALSE, do_draw_lines},
{"draw hiddenedges", FALSE, FALSE, do_draw_hidden_edges},
{"draw transparent", FALSE, FALSE, do_draw_transparent},
{"draw faces", FALSE, FALSE, do_draw_solid},
{"draw outlined", FALSE, FALSE, do_draw_outlined},
{"draw outlined white", FALSE, FALSE, do_draw_outlined_white},
{"draw outlined black", FALSE, FALSE, do_draw_outlined_black},
{"draw outlined <%f:color>", FALSE, FALSE, do_draw_outlined_color},
{"draw orthographic", FALSE, FALSE, do_project_ortho},
{"draw perspective", FALSE, FALSE, do_project_perspective},
{"draw flat", FALSE, FALSE, do_shade_flat},
{"draw gouraud", FALSE, FALSE, do_shade_gouraud},
{"draw linewidth <%f:linewidth>", FALSE, FALSE, do_draw_linewidth},
{"sphere size <%f:spheresize>", FALSE, FALSE, do_sphere_size},
{"sphere depth <%f:spheredepth>", FALSE, FALSE, do_sphere_depth},
/* Lights */
{"light one", FALSE, FALSE, do_light_one},
{"light two", FALSE, FALSE, do_light_two},
{"light three", FALSE, FALSE, do_light_three},
{"light x", FALSE, FALSE, do_light_x},
{"light y", FALSE, FALSE, do_light_y},
{"light z", FALSE, FALSE, do_light_z},
{"light twoside on", FALSE, FALSE, do_light_twoside_on},
{"light twoside off", FALSE, FALSE, do_light_twoside_off},
{"light off", FALSE, FALSE, do_light_off},
/* Drag */
{"drag [nothing|same_as_draw|box|vertices|edges|transparent|faces|outlined|hiddenedges]",
FALSE, FALSE, do_drag},
/* Props */
{"props axes [toggle|small|large|off]", FALSE, FALSE, do_overlay_axes},
{"props box [toggle|all|edges|faces|off]", FALSE, FALSE, do_overlay_box},
{"props focus [toggle|on|off]", FALSE, FALSE, do_overlay_focus},
{"props grid [all|xy|yz|xz|off]", FALSE, FALSE, do_overlay_grid},
{"props shadow [all|xy|yz|xz|off]", FALSE, FALSE, do_overlay_shadow},
{"props all off", FALSE, FALSE, do_overlay_all_off},
{"props legend [on|off]", FALSE, FALSE, do_legend},
{"props credits [on|off]", FALSE, FALSE, do_credits},
/* Movement */
{"move path cartesian|spherical", FALSE, FALSE, do_move_path},
{"move step <%f:movestepsize>", FALSE, FALSE, do_move_step},
/* Camera */
{"move camera <%f:to0> <%f:to1> <%f:to2> [<%f:twist>]", FALSE, FALSE,
setup_move_camera},
{"jump camera <%f:to0> <%f:to1> <%f:to2> [<%f:twist>]", FALSE, FALSE,
do_jump_camera},
/* Move camera remotely. */
{"movecursor <%f:xmove> <%f:ymove>", FALSE, FALSE, do_movecursor},
{"movecursorend", FALSE, FALSE, do_movecursorend},
/* Focus */
{"move focus point <%f:to0> <%f:to1> <%f:to2>", FALSE, FALSE,
setup_move_ref_pt},
{"move focus selected", FALSE, FALSE, setup_move_ref_sel},
{"jump focus point <%f:to0> <%f:to1> <%f:to2>", FALSE, FALSE,
do_jump_ref_pt},
{"jump focus selected", FALSE, FALSE, do_jump_ref_sel},
/* Time */
{"time [open|close]", FALSE, TRUE, do_animate},
{"time reverse [<%f:framecount>]", FALSE, FALSE, do_animate_reverse},
{"time reverse step", FALSE, FALSE, do_time_reverse_step},
{"time forward step", FALSE, FALSE, do_time_forward_step},
{"time forward [<%f:framecount>]", FALSE, FALSE, do_animate_forward},
{"time goto number [<%f:framenum>]", FALSE, FALSE, do_animate_goto_num},
{"time goto [<%s:framename>]", FALSE, FALSE, do_animate_goto},
{"time stop", FALSE, FALSE, do_animate_stop},
{"time delay [<%f:delay>]", FALSE, FALSE, do_time_delay},
{"time skip [<%f:skip>]", FALSE, FALSE, do_time_skip},
{"time reset", FALSE, FALSE, do_animate_reset},
{"time bounce [on|off]", FALSE, FALSE, do_time_bounce},
{"timeblock forward <%f:framecount>", FALSE, FALSE, do_timeblock_forward},
{"timeblock reverse <%f:framecount>", FALSE, FALSE, do_timeblock_reverse},
/* Palette */
{"palette [open|close]", FALSE, TRUE, do_win_open_palette},
{"palette use [default|rainbow|w_to_b|b_to_w|rgb|allyellow|redblue|whiteblue|yellowred]", FALSE,FALSE, do_cm_load},
{"palette load raw [<%s:palettepath>]", FALSE, FALSE, do_cm_load_raw},
{"palette load hdf [<%s:palettepath>]", FALSE, FALSE, do_cm_load_hdf},
{"palette scale <%f:scalestep> [single|continuous]", FALSE,FALSE, do_cm_scale},
{"palette shift <%f:shiftstep> [single|continuous]", FALSE,FALSE, do_cm_shift},
{"palette fiddle <%f:slope> <%f:origin>", FALSE, FALSE, do_cm_fiddle},
{"palette save raw [<%s:palettepath>]", FALSE, FALSE, do_cm_put_raw},
{"palette save hdf [<%s:palettepath>]", FALSE, FALSE, do_cm_put_hdf},
{"palette reset", FALSE, FALSE, do_cm_reset},
/* Backdrop */
{"backdrop [solid|horizon|sky|streak|smear|shaded] [black|white|grey|blue|red|green|yellow|rgby|rgblue|rbblack]",
FALSE, FALSE, do_backdrop},
/* Selecting */
{"select all", FALSE, FALSE, do_sel_all},
{"select [objects|vertices|faces]", FALSE, FALSE, do_sel},
{"select area <%f:left> <%f:bottom> <%f:right> <%f:top> [notoggle|toggle]",
FALSE, FALSE, do_sel_area},
/* Output */
{"save image [<%s:filename>]", FALSE, FALSE, do_save_image},
{"save mode [single|continuous]", FALSE, FALSE, do_save_mode},
{"save stop", FALSE, FALSE, do_save_stop},
{"blast image", FALSE, FALSE, do_blast_image},
{"blast mode [single|continuous]", FALSE, FALSE, do_blast_mode},
{"blast stop", FALSE, FALSE, do_blast_stop},
{"save rgb [<%s:filename>]", FALSE, FALSE, do_save_rgb},
{"save ray [<%s:filename>]", FALSE, FALSE, do_save_ray},
#ifdef RENDERMAN
{"save renderman [<%s:filename>]", FALSE, FALSE, do_save_renderman},
#endif /* RENDERMAN */
/* DTM output */
{"dtm in <%s:port>", FALSE, TRUE, do_dtm_in},
{"dtm out <%s:port>", FALSE, TRUE, do_dtm_out},
{"dtm send", FALSE, FALSE, do_dtm_send},
#ifdef PRIVATE_SUPPORT
{"dtm private", FALSE, FALSE, do_dtm_private},
{"dtm public", FALSE, FALSE, do_dtm_public},
#endif
{"\000", FALSE, TRUE, NULL},
};